package com.martin.dms.factories.hib;

import java.util.Date;

import com.martin.dms.factories.PurchaseFactory;
import com.martin.dms.model.Client;
import com.martin.dms.model.Item;
import com.martin.dms.model.Purchase;
import com.martin.dms.model.hib.PurchaseHib;

/**
 * Hibernate implementation of the Purchase factory.
 * 
 * @author mtsvetkov
 */
public class PurchaseFactoryHib implements PurchaseFactory {

    /**
     * {@inheritDoc}
     */
    public Purchase create(Client client, Item item, int amount, Date date) {
        PurchaseHib purchase = new PurchaseHib();
        purchase.setClient(client);
        purchase.setItem(item);
        purchase.setAmount(amount);
        purchase.setDate(date);
        return purchase;
    }
}
